package {
import mx.rpc.AsyncToken;
import mx.rpc.events.FaultEvent;

public class ServiceUtil {
    public static function execute(at:AsyncToken, result:Function, fault:Function = null):void {
        at.handlerReuslt = result;
        if (fault == null) {
            at.handlerFault = function(event:FaultEvent):void {
                trace(event.fault);
            };
        } else {
            at.handlerFault = fault;
        }
    }
}
}